package com.mxpio.erp.workshop.service.impl;

import com.mxpio.erp.common.technology.entity.ProcessInfo;
import com.mxpio.erp.common.workshop.entity.ManufactureOrderRoute;
import com.mxpio.erp.common.workshop.service.ManufactureOrderRouteService;
import com.mxpioframework.jpa.JpaUtil;
import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.jpa.query.Order;
import com.mxpioframework.system.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class ManufactureOrderRouteServiceImpl extends BaseServiceImpl<ManufactureOrderRoute> implements ManufactureOrderRouteService {
    @Override
    @Transactional
    public List<ManufactureOrderRoute> list(String bizNo) {
        Criteria orderRouteCri = Criteria.create();
        orderRouteCri.addOrder(new Order("processOrder",false));
        return JpaUtil.linq(ManufactureOrderRoute.class)
                .collect("processCode", ProcessInfo.class,"processCode")
                .equal("bizNo",bizNo).where(orderRouteCri).list();
    }
}
